Part Number Hot Search : 
FC110 0805C V15G02 NCP1547 SY889 74LVC2 BR604 SMB22
Product Description
Full Text Search
 

To Download ATAVRISP2 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  8-bit microcontrollers application note rev . 8015b-avr-02/06 avr069: avrisp mkii communication protocol features ? general commands ? isp commands ? return v a lues ? parameters 1 introduction this document describes the avrisp mkii protocol. the firmware is distributed with avr studio 4.12 or later. download t he latest avr studio from the atmel web s i te, http://www.atmel.com/products/avr/ . the definition of all commands, respons es, parameters and other defined values can be found in chapter 6.1. all device specific values can be found in the xml part description files. see chapter 4 for how to find the par ameter values for avrisp mkii. figure 1-1. avrisp mk ii
2 avr069 8015b-avr-02/06 2 usb communication the communication between the avrisp mkii and the pc is done through its usb interface. the usb interface utilizes two bulk endpoints; one in and one out. the usb descriptors can be found in chapter 6.2. 2.1 packet format the pc sends commands to the avrisp mk ii, which responds with an answer. each command will generate an answer. both commands and answers can be larger than the maximum packet size for the bulk endpoints, so a command or answer can be split into several in/out packets. a short packet indicates the end of a command or answer. the commands and their respective ans wers are described in chapter 3. 2.2 usb driver in order to communicate with the avrisp mkii, a driver must be installed on the host computer. a driver can be written from scrat ch or by using a driver development kit. avr studio 4 bundles a usb dr iver licensed from jungo ( www.jungo.com ). by obtaining a license from jungo, 3rd party so ftware can access the same driver as avr studio. the user can then use bot h avr studio and other tools without changing drivers. note: firmware upgrades for avrisp mkii c an only be uploaded with the dedicated upgrade software bundled with avr studio. this requires t hat the driver supplied with avr studio to be installed. 3 commands this section describes all commands that can be entered to the avrisp mkii, and all the possible responses that each command can give back to the host. for all commands, the avrisp mkii will return an answer with an answer id that is equal to the command id. the first byte in a command is always the command id, the first byte in an answer is always the answer id. 3.1 general commands 3.1.1 cmd_sign_on this command returns a unique signature string for the avrisp mkii with this implementation of the protocol. table 3-1 . command format field size value description command id 1 byte cmd_sign_on command id
avr069 3 8015b-avr-02/06 table 3-2 . answer format field size value description answer id 1 byte cmd_sign_on answer id status 1 byte status_cmd_ok this command will always return status_cmd_ok signature length 1 byte 10 length of signature string 10 bytes ?avrisp_mk2? the signature string (not null terminated) 3.1.2 cmd_set_parameter the host can set a multitude of paramet ers in the avrisp mkii. see the 3.4: parameters for a description of each param eter. all parameters are one-byte values. table 3-3 . command format field size value description command id 1 byte cmd_set_parameter command id parameter id 1 byte value 1 byte table 3-4 . answer format field size value description answer id 1 byte cmd_set_parameter answer id status 1 byte status_cmd_ok or status_cmd_failed a status value indicating the result of the operation 3.1.3 cmd_get_parameter the host can also read different parameters from the avrisp mkii. table 3-5 . command format field size value description command id 1 byte cmd_get_parameter command id parameter id 1 byte which parameter to get table 3-6 . answer format if command succeeds field size value description answer id 1 byte cmd_get_parameter answer id status 1 byte status_cmd_ok a status value indicating success signature length 1 byte the parameter value table 3-7 . answer format if fails field size value description answer id 1 byte cmd_get_parameter answer id
4 avr069 8015b-avr-02/06 field size value description status 1 byte status_cmd_failed a status value indicating that the operation failed. the only reason for the operation to fail is that an illegal parameter is requested. 3.1.4 cmd_osccal this command performs a calibration sequence as described in application note avr053. table 3-8 . command format field size value description command id 1 byte cmd_osccal command id table 3-9 . answer format field size value description answer id 1 byte cmd_osccal answer id status 1 byte status_cmd_ok or status_cmd_failed a status value indicating the result of the operation 3.1.5 cmd_load_address this command will load an address into t he avrisp mkii. the next program flash, read flash, program eeprom or read eeprom command will operate from the address set with this command. the command is used in all programming modes. all the abovementioned commands will increment an internal address counter, so this command needs only to be sent once. table 3-10 . command format field size value description command id 1 byte cmd_load_address command id address 4 bytes the address, four bytes, msb first for word-addressed memories (program flas h), the address parameter is the word address. if bit 31 is set, this indicates that the following read/write operation will be performed on a memory that is larger than 64kbytes. this is an indication to avrisp mkii that a load extended address must be executed. see datasheet for devices with memories larger than 64kbytes. table 3-11 . answer format . field size value description answer id 1 byte cmd_load_address answer id status 1 byte status_cmd_ok this command will always return status_cmd_ok
avr069 5 8015b-avr-02/06 3.1.6 cmd_firmware_upgrade when the host is trying to connect to the progr ammer, it checks the firmware version. a firmware upgrade is initiated if a newer version is available on the pc. the avrisp mkii can ?reboot? into upgr ade mode by using this command. table 3-12 . command format field size value description command id 1 byte cmd_firmware_upgrade command id parameter id 9 bytes ?fwupgrade? string to enable upgrade mode (not null terminated) table 3-13 . answer format field size value description answer id 1 byte cmd_firmware_upgrade answer id status 1 byte status_cmd_ok or status_cmd_failed a status value indicating the result of the operation if the status returned is status_cmd _ok, the avrisp mkii will disconnect and enter upgrade mode. 3.1.7 cmd_reset_protection this command resets the short circuit protec tion system after a short circuit state has been returned by the param_status_tgt_conn. table 3-14 . command format field size value description command id 1 byte cmd_reset_protection command id table 3-15 . answer format field size value description answer id 1 byte cmd_reset_protection answer id status 1 byte status_cmd_ok this command will always return status_cmd_ok 3.2 isp programming commands these commands handles flash, eeprom, fu se bytes, lock bits, signature and oscillator calibration programming in isp mode. 3.2.1 cmd_enter_progmode_isp this command will make the target device enter programming mode. xml path: /avrpart/ice_settings/stk500_2/ispenterprogmode/ table 3-16 . command form field size value description
6 avr069 8015b-avr-02/06 field size value description command id 1 byte cmd_enter_prog mode_isp command id timeout 1 byte xml: timeout command time-out (in ms) stabdelay 1 byte xml: stabdelay delay (in ms) used for pin stabilization cmdexedelay 1 byte xml: cmdexedelay delay (in ms) in connection with the enterprogmode command execution synchloops 1 byte xml: synchloops nu mber of synchronization loops bytedelay 1 byte xml: bytedelay delay (in ms) between each byte in the enterprogmode command. pollvalue (1) 1 byte xml: pollvalue poll value: 0x53 for avr, 0x69 for at89xx pollindex 1 byte xml: pollindex start address, received byte: 0 = no polling, 3 = avr, 4 = at89xx cmd1 1 byte command byte # 1 to be transmitted cmd2 1 byte command byte # 2 to be transmitted cmd3 1 byte command byte # 3 to be transmitted cmd4 1 byte command byte # 4 to be transmitted note: 1. the pollvalue parameter indicates a fter which of the transmitted bytes on the spi interface to store the return byte, as the spi interface is implemented as a ring buffer (one byte out, one byte in) table 3-17 . answer format field size value description answer id 1 byte cmd_enter_prog_m ode_isp answer id status 1 byte status_cmd_tout, status_cmd_ok or status_cmd_failed a status value indicating the result of the operation 3.2.2 cmd_leave_progmode_isp this command will make avrisp mkii leav e programming mode. the device will be put into normal operating mode. xml path: /avrpart/ice_settings/avrisp mkii_2/ispleaveprogmode/ table 3-18 . command format field size value description command id 1 byte cmd_leave_progmode_isp command id predelay 1 byte xml: predelay pre-delay (in ms) postdelay 1 byte xml: postdelay post-delay (in ms) table 3-19 . answer format field size value description
avr069 7 8015b-avr-02/06 field size value description answer id 1 byte cmd_leave_progmode_isp answer id status 1 byte status_cmd_ok this command will always return status_cmd_ok 3.2.3 cmd_chip_erase_isp this command will perform a chip erase on the target device. xml path: /avrpart/ice_setti ngs/stk500_2/ispchiperase/ table 3-20 . command form field size value description command id 1 byte cmd_chip_erase_isp command id erasedelay 1 byte xml: erasedelay delay (in ms) to ensure that the erase of the device is finished pollmethod 1 byte xml: pollmethod poll method, 0 = use delay1= use rdy/bsy command cmd1 1 byte chip erase command byte #1 cmd2 1 byte chip erase command byte #2 cmd3 1 byte chip erase command byte #3 cmd4 1 byte chip erase command byte #4 table 3-21 . answer format field size value description answer id 1 byte cmd_chip_erase_isp answer id status 1 byte status_cmd_ok or status_cmd_tout a status value indicating the result of the operation 3.2.4 cmd_program_flash_isp this command will program data into the flash memory of the target device if it succeeds. xml path: /avrpart/ice_settings/stk500_2/ispprogramflash/ table 3-22 . command form field size value description command id 1 byte cmd_program_flash _isp command id numbytes 2 byte total number of bytes to program, msb first mode 1 byte xml: mode * mode byte* delay 1 byte xml: delay delay, used for different types of programming termination, according to mode byte cmd1 1 byte command 1 (load page, write program memory)
8 avr069 8015b-avr-02/06 field size value description cmd2 1 byte command 2 (write program memory page) cmd3 1 byte command 3 (read program memory) poll1 1 byte xml: pollval1 poll value #1 poll2 1 byte xml: pollval2 poll value #2 (not used for flash programming) data n bytes n data *mode byte the mode parameter is essential for how this command works. the bits in the mode byte have the following meanings: bit # description mode 0 word/page mode (0 = word, 1 = page) 1 timed delay 2 value polling 3 rdy/bsy polling word mode 4 timed delay 5 value polling 6 rdy/bsy polling 7 write page page mode the word/page mode bit selects if the device supports page programming or not. the command bytes are different for word and page mode. in word mode, the isp commands write program memory and read program memory are used. in page mode, load page, write program memory page and read program memory are used. the read instruction is used if value polling is specified in the mode bit. the low/high byte selection bit (3 rd bit in the load page, write program memory commands) is handled by avrisp mkii, so leave this bit cleared. according to the mode, different termination methods are selected ? timed delay , value polling or rdy/bsy polling . for paged operation, the write page bit decides if a write program memory page command should be issued after the data has been loaded into the page buffer. for devices with page size bigger than what can be transferred to avrisp mkii in one command, several cmd_program_flash_isp commands must be issued. in such a case, only the last command should have the write page mode bit set. note: only bit 0-6 are set in the xml file, bec ause bit 7 is not const ant and must be controlled by the pc software. when value polling is used to determine when a programming operation is complete, poll1 must be supplied. this value indicates which value will be read from the device until the programmed value is read. this indicates end of programming. poll2 is used only for eeprom programming.
avr069 9 8015b-avr-02/06 table 3-23 . answer format field size value description answer id 1 byte cmd_program_flash_isp answer id status 1 byte status_cmd_ok, status_cmd_tout or status_rdy_bsy_tout a status value indicating the result of the operation 3.2.5 cmd_read_flash_isp this command will read data from the flash memory of the target device if it succeeds. xml path: /avrpart/ice_settings/ stk500_2/ispreadflash/ table 3-24 . command format field size value description command id 1 byte cmd_read_flash_isp command id numbytes 2 bytes xml: blocksize total number of bytes to read, msb first cmd1 1 byte read program memory command byte #1. low/high byte selection bit (3rd bit) is handled in the firmware. table 3-25 . answer format if the command is executed field size value description answer id 1 byte cmd_read_flash_isp answer id status1 1 byte status_cmd_ok indicates success. will always read ok data n bytes the data read from the device status2 1 byte status_cmd_ok a status value indicating the result of the operation. will always read ok table 3-26 . answer format if the command was not executed field size value description answer id 1 byte cmd_read_flash_isp answer id status 1 byte status_cmd_failed indicates failure 3.2.6 cmd_program_eeprom_isp see the cmd_program_flash_isp command. 3.2.7 cmd_read_eeprom_isp see the cmd_read_flash_isp command. 3.2.8 cmd_program_fuse_isp this command programs the fuses of the target device.
10 avr069 8015b-avr-02/06 table 3-27 . command form field size value description command id 1 byte cmd_program_fuse_isp command id cmd1 1 byte command byte #1 cmd2 1 byte command byte #2 cmd3 1 byte command byte #3 cmd4 1 byte command byte #4 note: cmd1, cmd2, cmd3 and cmd4 are the four bytes of the low-level program fuse isp command. table 3-28 . answer format field size value description answer id 1 byte cmd_program_fuse_isp answer id status1 1 byte status_cmd_ok will always read ok status2 1 byte status_cmd_ok will always read ok 3.2.9 cmd_read_fuse_isp this command reads the fuses of the target device. table 3-29 . command form field size value description command id 1 byte cmd_read_fuse_isp command id retaddr 1 byte xml: pollindex return address cmd1 1 byte command byte #1 cmd2 1 byte command byte #2 cmd3 1 byte command byte #3 cmd4 1 byte command byte #4 note: retaddr indicates after which of the tr ansmitted bytes on the spi interface to store the return byte, as the spi interface is implemented as a ring buffer (one byte out, one byte in) table 3-30 . answer format field size value description answer id 1 byte cmd_read_fuse_isp answer id status1 1 byte status_cmd_ok a status value indicating the result of the operation, always ok data 1 byte the fuse byte read from the device status2 1 byte status_cmd_ok a status value indicating the result of the operation, always ok
avr069 11 8015b-avr-02/06 3.2.10 cmd_program_lock_isp see cmd_program_fuse. this command is basically the same as the program fuse command, only that isp commands for programming the lock byte must be supplied. 3.2.11 cmd_read_lock_isp see cmd_read_fuse. this command is basically the same as the read fuse command, only that isp commands for r eading the lock byte must be supplied. 3.2.12 cmd_read_signature_isp see cmd_read_fuse. this command is basically the same as the read fuse command, only that isp commands for r eading one of the signature bytes must be supplied. 3.2.13 cmd_read_osccal_isp see cmd_read_fuse. this command is basically the same as the read fuse command, only that isp commands for readi ng the osccal byte must be supplied. 3.2.14 cmd_spi_multi this is a generic command that can be us ed to execute any of the isp commands. the command writes a number of bytes to the spi bus, and returns a number of bytes. table 3-31 . command format field size value description command id 1 byte cmd_spi_multi command id numtx 1 byte 0-255 number of bytes to transmit numrx 1 byte 0-255 number of bytes to receive rxstartaddr 1 byte start address of returned data. specifies on what transmitted byte the response is to be stored and returned. txdata 0-255 bytes the data be transmitted. the size is specified by numtx note: if the number of bytes to receive is greater than number of bytes to transmit, then the firmware will pad with the necessary 0x00 bytes. this is in order to save time- consuming transfer from pc to the programmer. table 3-32 . answer format field size value description answer id 1 byte cmd_spi_multi answer id status1 1 byte status_cmd_ok will always read ok data 0-255 bytes the data read from the isp bus as indicated in the command status2 1 byte status_cmd_ok will always read ok
12 avr069 8015b-avr-02/06 3.3 return values this section describes all possible return values and their meaning in detail. 3.3.1 success table 3-33 . success value meaning status_cmd_ok command executed ok 3.3.2 warnings all warnings have msb set to 1 and msb-1 set to 0. table 3-34 . success value meaning status_cmd_tout command timed out status_rdy_bsy_tout sampling of the rdy/nbsy pin timed out status_set_param_missing the ?set device parameters? have not been executed in advance of this command 3.3.3 errors all errors have msb and msb-1 set to 1. table 3-35 . success value meaning status_cmd_failed command failed status_cmd_unknown unknown command 3.4 parameters the following parameters can be read and/or written by the cmd_get_param and cmd_set_param commands. table 3-36 . success value meaning r/w param_build_number_low firmware build number, high byte r param_build_number_high firmware build number, low byte r param_hw_ver hardware version r param_sw_major firmware version number, major byte r param_sw_minor firmware version number, minor byte r param_vtarget target voltage r param_sck_duration isp sck duration r/w param_reset_polarity active low or active high reset handling w param_status_tgt_conn status of target connection r param_dischargedelay delay with higher resistance of reset line w
avr069 13 8015b-avr-02/06 3.4.1 param_build_number_low the param_build_number_low and par am_build_number_high together return a number that is incremented for each build of the firmware. this number is mainly for atmel internal use. 3.4.2 param_build _number_high see param_build_number_low. 3.4.3 param_hw_ver returns a hardware revision number. 3.4.4 param_sw_major the param_sw_major and param_sw_minor returns the firmware version. 3.4.5 param_sw_minor see param_sw_major. 3.4.6 param_vtarget the parameter value is voltage in volts x10, i.e. a parameter value of 42 (decimal) corresponds to 4.2v. 3.4.7 param_sck_duration when using the isp programming interface, the isp clock frequency must not exceed what the target device supports. (the maximum isp clock frequency depends on the device system clock, inte rnal clock division etc.) the avrisp mkii supports isp frequencies from 51 hz up to 8.0 mhz. the value for param_sck_duration can be found using the algorithm shown in chapter 6.3. 3.4.8 param_reset_polarity the avrisp mkii can program both at90 ( avr) family and at89 (8051) family of microcontrollers. they have different reset pin polarity. the avr has active low reset, while the at89 has active high. this parameter sets the polarity of the reset signal. set the parameter to 1 when programming avrs, and 0 when programming at89 controllers. note: avrisp mkii stores this parameter in eeprom, so they are available the next time power is applied to the programmers. 3.4.9 param_status_tgt_conn this parameter returns the status of the target connection. each bit has a separate status. see table below: table 3-37 . success bit value status 0x00 status_isp_ready 0x01 status_conn_fail_mosi 0x02 status_conn_fail_rst
14 avr069 8015b-avr-02/06 bit value status 0x04 status_conn_fail_sck 0x10 status_tgt_not_detected 0x20 status_tgt_reverse_inserted 0x00 status_isp_ready the corresponding bit will be set ?1? to indicate an error. that is, if a line is short-circuited, if target is not detected or the plug is inserted with a reverse orientation. if the value 0x00 is returned it means the connection is ok. if any *_conn_fail_* bit is set, the command cmd_reset_protection must be issued. the parameter should be checked before starting a programming sequence to check if target connection is correct. it should also be checked after a programming sequence if the command failed to check if the operation failed because of a short circuit. a short circuit can only be detected after the command enter progmode has been issued, because the control circuits of t he avrisp mkii is isolat ed via switches when the avrisp mkii is in idle mode. 3.4.10 param_dischargedelay this parameter sets a time period for which the reset line has a higher resistance for each time it is toggled. the purpose is to reduce the maximum current caused by the discharge/recharge of a decoupling capacitor connected to the reset pin. when the reset is toggled a resistor of 510ohm will be switched in, which reduces the peak current to an acceptable level for t he internal components of the avrisp mkii. the delay should be set to: t>510ohm*c if no capacitor is connected this parameter could be set to 0. 4 xml parameter values the avrisp mkii firmware uses paramet ers extensively for its programming algorithms. all avr devices have their own set of parameters. they can be found in part description files installed with avr studi o. the part description files are xml files and can be found in the folder ? \atmel\avr tools\partdescriptionfiles\
avr069 15 8015b-avr-02/06 figure 4-1. xml file example: atmega2561.xml open the xml file in an xml editor/viewer (e .g xml notepad or internet explorer). all device specific values for avrisp mkii are located under stk500_2 node. for parameters for e.g. the cmd_enter_pr ogmode_isp command, look at the node /avrpart/ice_settings_stk500_2/ispenterprogmode 5 command sequence example this chapter contains examples of how to connect to the avri sp mkii from the pc frontend and how to read signature from a device. see chapter 3 for a description of the commands and parameters. 5.1 connect the sequence of commands and parameters s ent from avr studio to the avrisp mkii in order to c onnect is listed below. ? cmd_sign_on ? cmd_get_parameter, param_hw_ver
16 avr069 8015b-avr-02/06 ? cmd_get_parameter, param_sw_major ? cmd_get_parameter, param_sw_minor 5.2 read signature the sequence of commands and parameters s ent from avr studio to the avrisp mkii in order to read the device signature through isp is listed below. note that one already has to be connected to do this. ? cmd_set_parameter, param_reset_polarity ? cmd_get_parameter, param_status_tgt_conn ? cmd_enter_progmode_isp ? cmd_read_signature_isp ? cmd_read_signature_isp ? cmd_read_signature_isp ? cmd_leave_progmode_isp
avr069 17 8015b-avr-02/06 6 appendix 6.1 commands and parameters // *** [ general command constants ] *** #define cmd_sign_on 0x01 #define cmd_set_parameter 0x02 #define cmd_get_parameter 0x03 #define cmd_osccal 0x05 #define cmd_load_address 0x06 #define cmd_firmware_upgrade 0x07 #define cmd_reset_protection 0x0a // *** [ isp command constants ] *** #define cmd_enter_progmode_isp 0x10 #define cmd_leave_progmode_isp 0x11 #define cmd_chip_erase_isp 0x12 #define cmd_program_flash_isp 0x13 #define cmd_read_flash_isp 0x14 #define cmd_program_eeprom_isp 0x15 #define cmd_read_eeprom_isp 0x16 #define cmd_program_fuse_isp 0x17 #define cmd_read_fuse_isp 0x18 #define cmd_program_lock_isp 0x19 #define cmd_read_lock_isp 0x1a #define cmd_read_signature_isp 0x1b #define cmd_read_osccal_isp 0x1c #define cmd_spi_multi 0x1d // *** [ status constants ] *** // success #define status_cmd_ok 0x00 // warnings #define status_cmd_tout 0x80 #define status_rdy_bsy_tout 0x81 #define status_set_param_missing 0x82 // errors #define status_cmd_failed 0xc0
18 avr069 8015b-avr-02/06 #define status_cmd_unknown 0xc9 // *** [ parameter constants ] *** #define param_build_number_low 0x80 #define param_build_number_high 0x81 #define param_hw_ver 0x90 #define param_sw_major 0x91 #define param_sw_minor 0x92 #define param_vtarget 0x94 #define param_sck_duration 0x98 #define param_reset_polarity 0x9e #define param_status_tgt_conn 0xa1 #define param_dischargedelay 0xa4 // status #define status_isp_ready 0x00 #define status_conn_fail_mosi 0x01 #define status_conn_fail_rst 0x02 #define status_conn_fail_sck 0x04 #define status_tgt_not_detected 0x10 #define status_tgt_reverse_inserted 0x20 6.2 usb descriptors table 6-1 . device descriptor name value hex blength valid 0x12 bdescriptortype device 0x01 bcdusb 1.1 0x0110 bdeviceclass vendor-specific 0xff bdevicesubclass vendor-specific 0x00 bdeviceprotocol none 0x00 bmaxpacketsize0 16 0x10 idvendor atmel corporation 0x03eb idproduct 0x2104 0x2104 bcddevice 2.0 0x0200 imanufacturer 1 0x01 iproduct 2 "avrisp mkii" 0x02 iserialnumber 3 0x03 bnumconfigurations 1 0x01
avr069 19 8015b-avr-02/06 table 6-2 . configuration descriptor name value hex blength valid 0x09 bdescriptortype configuration 0x02 wtotallength 32 bytes 0x0020 bnuminterface 1 0x01 bconfigurationvalue 1 0x01 iconfiguration 0 0x00 bmattributes. reserved zero 0x00 bmattributes. remotewakeup not supported 0x0 bmattributes. selfpowered yes 0x1 bmattributes. reserved7 one 0x1 bmaxpower 200 ma 0x64 table 6-3 . interface descriptor name value hex blength valid 0x09 bdescriptortype interface 0x04 binterfacenumber 0 0x00 balternatesetting 0 0x00 bnumendpoints 2 0x02 binterfaceclass vendor-specific 0xff binterfacesubclass vendor-specific 0x00 binterfaceprotocol none 0x00 iinterface 0 0x00 table 6-4 . endpoint descriptor in name value hex blength valid 0x07 bdescriptortype endpoint 0x05 bendpointaddress 2 in 0x82 bmattributes. transfertype bulk 0x2 bmattributes. reserved zero 0x00 wmaxpacketsize 64 bytes 0x0040 binterval ignored for bulk endpoints 0x0a table 6-5 . endpoint descriptor out name value hex blength valid 0x07 bdescriptortype endpoint 0x05
20 avr069 8015b-avr-02/06 name value hex bendpointaddress 2 out 0x02 bmattributes. transfertype bulk 0x2 bmattributes. reserved zero 0x00 wmaxpacketsize 64 bytes 0x0040 binterval ignored for bulk endpoints 0x0a 6.3 setting sck frequency the avrisp mkii supports t he sck frequencies shown in avrispmkiifreqs below. use the calcsckdur( ) algorithm to find the param_sck_duration value for a given frequency: // frequencies for avrisp mkii isp programming double avrispmkiifreqs[] = { 8000000, 4000000, 2000000, 1000000, 500000, 250000, 125000, 96386, 89888, 84211, 79208, 74767, 70797, 67227, 64000, 61069, 58395, 55945, 51613, 49690, 47905, 46243, 43244, 41885, 39409, 38278, 36200, 34335, 32654, 31129, 29740, 28470, 27304, 25724, 24768, 23461, 22285, 21221, 20254, 19371, 18562, 17583, 16914, 16097, 15356, 14520, 13914, 13224, 12599, 12031, 11511, 10944, 10431, 9963, 9468, 9081, 8612, 8239, 7851, 7498, 7137, 6809, 6478, 6178, 5879, 5607, 5359, 5093, 4870, 4633, 4418, 4209, 4019, 3823, 3645, 3474, 3310, 3161, 3011, 2869, 2734, 2611, 2484, 2369, 2257, 2152, 2052, 1956, 1866, 1779, 1695, 1615, 1539, 1468, 1398, 1333, 1271, 1212, 1155, 1101, 1049, 1000, 953, 909, 866, 826, 787, 750, 715, 682, 650, 619, 590, 563, 536, 511, 487, 465, 443, 422, 402, 384, 366, 349, 332, 317, 302, 288, 274, 261, 249, 238, 226, 216, 206, 196, 187, 178, 170, 162, 154, 147, 140, 134, 128, 122, 116, 111, 105, 100, 95.4, 90.9, 86.6, 82.6, 78.7, 75.0, 71.5, 68.2, 65.0, 61.9, 59.0, 56.3, 53.6, 51.1 }; uchar calcsckdur(long sckfrequency) { uchar paramsckduration; // default to slowest value paramsckduration = (uchar)sizeof(avrispmkiifreqs)-1; // find first frequency that is less than the requested for (int i = 0; i < sizeof(avrispmkiifreqs); i++) {
avr069 21 8015b-avr-02/06 if (avrispmkiifreqs[i] <= sckfrequency) { paramsckduration = i; break; } } return paramsckduration; }
22 avr069 8015b-avr-02/06 table of contents features ............................................................................................... 1 1 introduction ...................................................................................... 1 2 usb communication ....................................................................... 2 2.1 packet format ..................................................................................................... 2 2.2 usb driver ........................................................................................................... 2 3 commands ....................................................................................... 2 3.1 general commands ............................................................................................ 2 3.1.1 cmd_sign_on ........................................................................................................ 2 3.1.2 cmd_set_parameter ......................................................................................... 3 3.1.3 cmd_get_parameter ......................................................................................... 3 3.1.4 cmd_osccal ......................................................................................................... 4 3.1.5 cmd_load_address ........................................................................................... 4 3.1.6 cmd_firmware_upgrade ................................................................................. 5 3.1.7 cmd_reset_protection ................................................................................... 5 3.2 isp programming commands ............................................................................. 5 3.2.1 cmd_enter_progmode_isp ............................................................................. 5 3.2.2 cmd_leave_progmode_isp .............................................................................. 6 3.2.3 cmd_chip_erase_isp .......................................................................................... 7 3.2.4 cmd_program_flash_isp ................................................................................ 7 3.2.5 cmd_read_flash_isp ......................................................................................... 9 3.2.6 cmd_program_eeprom_isp ............................................................................ 9 3.2.7 cmd_read_eeprom_isp ..................................................................................... 9 3.2.8 cmd_program_fuse_isp .................................................................................. 9 3.2.9 cmd_read_fuse_isp ......................................................................................... 10 3.2.10 cmd_program_lock_isp .............................................................................. 11 3.2.11 cmd_read_lock_isp ....................................................................................... 11 3.2.12 cmd_read_signature_isp ............................................................................ 11 3.2.13 cmd_read_osccal_isp .................................................................................. 11 3.2.14 cmd_spi_multi .................................................................................................. 11 3.3 return values .................................................................................................... 12 3.3.1 success ................................................................................................................... 12 3.3.2 warnings ................................................................................................................. 12 3.3.3 errors ....................................................................................................................... 12 3.4 parameters ........................................................................................................ 12 3.4.1 param_build_number_low ........................................................................... 13 3.4.2 param_build_number_high ........................................................................... 13 3.4.3 param_hw_ver .................................................................................................. 13 3.4.4 param_sw_major ............................................................................................. 13 3.4.5 param_sw_minor .............................................................................................. 13 3.4.6 param_vtarget ................................................................................................. 13 3.4.7 param_sck_duration ...................................................................................... 13 3.4.8 param_reset_polarity .................................................................................. 13 3.4.9 param_status_tgt_conn .............................................................................. 13 3.4.10 param_dischargedelay ............................................................................... 14
avr069 23 8015b-avr-02/06 4 xml parameter values .................................................................. 14 5 command sequence example ...................................................... 15 5.1 connect ............................................................................................................. 15 5.2 read signature ................................................................................................. 16 6 appendix ......................................................................................... 17 6.1 commands and parameters .............................................................................. 17 6.2 usb descriptors ................................................................................................ 18 6.3 setting sck frequency ..................................................................................... 20 table of contents .............................................................................. 22 disclaimer ............................................................................................. 24
disclaimer atmel corporation 2325 orchard parkw a y san jose, ca 95131, usa t e l: 1(408) 441-0311 f a x: 1(408) 487-2600 regional headquarters e u rope atmel sarl route des arsenaux 41 case postale 80 ch-1705 f r ibourg sw itzerland t e l: (41) 26-426-5555 f a x: (41) 26-426-5500 asia room 1219 chinachem golden plaza 77 mody road t s imshatsui east kow l oon hong kong t e l: (852) 2721-9778 f a x: (852) 2722-1369 japan 9f , t onetsu shinkaw a bldg. 1-24-8 shinkaw a chuo-ku, t o ky o 104-0033 japan t e l: (81) 3-3523-3551 f a x: (81) 3-3523-7581 atmel operations memo ry 2325 orchard parkw a y san jose, ca 95131, usa t e l: 1(408) 441-0311 f a x: 1(408) 436-4314 m i crocont r ol l e rs 2325 orchard parkw a y san jose, ca 95131, usa t e l: 1(408) 441-0311 f a x: 1(408) 436-4314 la chantrerie bp 70602 44306 nantes cedex 3, f r ance t e l: (33) 2-40-18-18-18 f a x: (33) 2-40-18-19-60 asic/assp/smart cards z one industrielle 13106 rousset cedex, f r ance t e l: (33) 4-42-53-60-00 f a x: (33) 4-42-53-60-01 1150 east chey enne mtn. blvd. colorado springs, co 80906, usa t e l: 1(719) 576-3300 f a x: 1(719) 540-1759 scottish enterprise t e chnology park maxw ell building east kilbride g75 0qr, scotland t e l: (44) 1355-803-000 f a x: (44) 1355-242-743 rf/auto mo tive t heresienstrasse 2 postfach 3535 74025 heilbronn, germany t e l: (49) 71-31-67-0 f a x: (49) 71-31-67-2340 1150 east chey enne mtn. blvd. colorado springs, co 80906, usa t e l: 1(719) 576-3300 f a x: 1(719) 540-1759 bio m etrics/ima g i ng /hi-rel mpu/ high speed converters/rf datacom avenue de rochepleine bp 123 38521 saint-egreve cedex, f r ance t e l: (33) 4-76-58-30-00 f a x: (33) 4-76-58-34-80 litera ture req u ests www. a t m e l . c o m / l i t e r a t u r e disclaimer: the information in this document is prov ided in connection w i th atmel products. no licens e, ex press or implied, by estoppel or otherw i se, to any intellectual property right is granted by this document or in connection w i th the sale of atmel products. except a s set forth in a t m e l?s term s a nd conditions of sa le loca ted on a t m e l?s web site, a t m e l a ssum es no lia b ilit y wha t soever a nd discla im s a n y express, im plied or sta t utory wa rra nty rela ti ng to i t s products i ncludi ng, but not li m i ted to, the i m pli e d wa rra nty of m e rcha nta b i l i t y, fitness for a pa rticula r purpo se, or non-infringem e nt. in no event sha ll a t m e l be li a b le for a n y direct, indirect, consequentia l, puniti ve, specia l or incidenta l da m a ges (including, without lim i ta tion, da m a ges for loss of profits, business i n terrupti on, or loss of i n form a t i o n) a r i s i n g out of the use or i n a b i l i t y to use thi s docum ent, even i f a t m e l ha s been a d vi sed of the possi bi li ty of such da m a ges. atmel makes no representations or w a rranties w i th respect to the accuracy or completeness of the contents of this document and reserv es the right to make c hanges to specifications and product descriptions at any time w i thout notice. atmel does not make any commitment to update the informat ion contained herein. unless spec ifically prov ided otherw i se, at mel products are not suitable for, and shall not be used in, automotiv e applications. at mel?s products are not in tended, authorized, or w a rranted for us e as components in applications inte nded to support or sustain life. ? a t mel corporation 2006. a ll rights reserv e d . atmel?, logo and combinations thereof, every w here y ou are?, avr?, avr studio? and others, are the registered trademarks or tr ademarks of atmel corporation or its subs idiaries. other terms and product names may be trademarks of others. 8015b-avr-02/06


▲Up To Search▲   

 
Price & Availability of ATAVRISP2

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X